﻿namespace DataCenter.Data
{
    using DataCenter.Configuration;
    using DataCenter.Data.DBConfig;
    using DataCenter.Model.Model;
    using System.Linq;
    using System.Data.Entity;
    using DataCenter.Model.Model;

    public class DataCenterEntities : DbContext
    {
        public DataCenterEntities() : base(SystemConfiguration.ConnectionString) { }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.Configurations.Add(new DataCenterConfiguration());
            modelBuilder.Configurations.Add(new ModelCatConfiguration());
            modelBuilder.Configurations.Add(new RegionConfiguration());
            modelBuilder.Configurations.Add(new ProvinceConfiguration());
            modelBuilder.Configurations.Add(new DistrictConfiguration());
            modelBuilder.Configurations.Add(new ShopInfConfiguration());
            modelBuilder.Configurations.Add(new ShopBilltoConfiguration());
            modelBuilder.Configurations.Add(new ShopCellConfiguration());
            modelBuilder.Configurations.Add(new BilltoInfConfiguration());
            modelBuilder.Configurations.Add(new OrderConfiguration());
            modelBuilder.Configurations.Add(new ShippingConfiguration());
            modelBuilder.Configurations.Add(new OrganizationConfiguration());
            modelBuilder.Configurations.Add(new ResponseSMSConfiguration());
            modelBuilder.Configurations.Add(new IncentiveAdhocConfiguration());
            modelBuilder.Configurations.Add(new AdhocDetailConfiguration());
            modelBuilder.Configurations.Add(new SerialNumberCdcHistConfiguration());
            modelBuilder.Configurations.Add(new SerialNumberPndHistConfiguration());
            modelBuilder.Configurations.Add(new SerialNumberRdcHistConfiguration());
            modelBuilder.Configurations.Add(new WarrantyMasterConfiguration());
            modelBuilder.Configurations.Add(new WarrantyMessageConfiguration());
            modelBuilder.Configurations.Add(new WarrantyHistoryConfiguration());
            modelBuilder.Configurations.Add(new MessageHistoryConfiguration());
            modelBuilder.Configurations.Add(new MessageSendConfiguration());
            modelBuilder.Configurations.Add(new MrpConfiguration());
        }

        public DbSet<DataCenters> DataCenters { get; set; }
        public DbSet<District> Districts { get; set; }
        public DbSet<Province> Provinces { get; set; }
        public DbSet<Region> Regions { get; set; }
        public DbSet<ShopInf> ShopInf { get; set; }
        public DbSet<ShopBillto> ShopBillto { get; set; }
        public DbSet<ShopCell> ShopCell { get; set; }
        public DbSet<ModelCat> ModelCat { get; set; }
        public DbSet<BilltoInf> BilltoInf { get; set; }
        public DbSet<OrderInfo> Orders { get; set; }
        public DbSet<ShippingInfo> ShippingInfos { get; set; }
        public DbSet<Organization> Organizations { get; set; }
        public DbSet<ResponseSMS> ResponseSMSs { get; set; }
        public DbSet<AdhocDetail> AdhocDetails { get; set; }
        public DbSet<IncentiveAdhoc> IncentiveAdhoc { get; set; }
        public DbSet<SerialNumberRdcHist> SerialNumberRdcHistory { get; set; }
        public DbSet<SerialNumberPndHist> SerialNumberPndHist { get; set; }
        public DbSet<SerialNumberCdcHist> SerialNumberCdcHistory { get; set; }
        public DbSet<WarrantyMaster> WarrantyMaster { get; set; }
        public DbSet<WarrantyMessage> WarrantyMessage { get; set; }
        public DbSet<WarrantyHistory> WarrantyHistory { get; set; }
        public DbSet<MessageHistory> MessageHistory { get; set; }
        public DbSet<MessageSend> MessageSend { get; set; }
        public DbSet<MRP> Mrp { get; set; }
    }
}
